/*
 * @Author: linZeJian
 * @Date: 2022-04-27 17:19:27
 * @LastEditors: linZeJian
 * @LastEditTime: 2022-04-28 10:59:12
 * @Description: 
 */

'use strict'
const path = require('path')

function resolve(dir) {
  return path.join(__dirname, dir)
}

const name = process.env.VUE_APP_TITLE || '网页标题' // 网页标题

// vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
// 这里只列一部分，具体配置参考文档
module.exports = {
  publicPath: process.env.BASE_URL,
	outputDir: 'dist',
	devServer: {
		disableHostCheck: true,
		proxy: {
			[process.env.VUE_APP_BASE_API]: {
				target: 'http://192.168.10.86:8090/task-management/api/',
				assetsPublicPath: '/',
				changeOrigin: true, //是否允许跨越
				pathRewrite: {
					['^' + process.env.VUE_APP_BASE_API]: '', //重写,
				},
			},
      [process.env.VUE_APP_FILEBASE_API]: {
				target: 'https://tobacco.oars.gzsunrun.cn/filebase/',
				assetsPublicPath: '/',
				changeOrigin: true, //是否允许跨越
				pathRewrite: {
					['^' + process.env.VUE_APP_FILEBASE_API]: '', //重写,
				},
			}
		},
		host: '0.0.0.0',
		port: 9072, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
		https: false
	},
	productionSourceMap: false, //去掉.map文件，文件体积会小很多
  configureWebpack: {
    name: name,
    resolve: {
      alias: {
        '@': resolve('src')
      }
    },
    output: {
      library: 'icestark-app-element',
      libraryTarget: 'umd',
    },

  }
}
